
#pragma once
#include "xmldocument.h"
#include "list"
using namespace std;

struct db
{
	wstring db_size;
	wstring db_unused_size;
	wstring name;
	wstring db_path;
	wstring log_path;
	wstring user;
	wstring pwd;
	wstring create_time;
};


class ConfigManager :
	public XmlDocument
{
	wstring max_connection;
	wstring dba_name;
	wstring dba_pwd;
	wstring str_port;
	
	list<db> list_db;
public:
	ConfigManager(void);
	// Load the configuration file from the default path
	void LoadConfigInfo();
	// Get the stored database list
	list<db>& GetListDB();
	// Get the max_connection count allowed
	wstring GetMaxConnection();
	// Get the DBA's name
	wstring GetDBAName();
	// Get the DBA's password
	wstring GetDBAPwd();
	// Add a new database
	bool AddDatabase(db cdb);
	// Get the port 
	wstring GetPort();
	// Save the configuration file to the default path.
	void Save();
	
	~ConfigManager(void);

};
